-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf: batch block list settings in single action #61329
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +34 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
@jsnajdr Curious what you think about this :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good, but I think we don't really need the new private action. The existing updateBlockListSettings
action could have both non-batch and batch forms:
updateBlockListSettings( clientId, settings );
updateBlockListSettings( clientId, null ); // delete
updateBlockListSettings( {
[ clientId1 ]: settings1,
[ clientId2 ]: null,
} );
There is prior art for this (like passing a block object or an array of blocks) and it's easily typable with TypeScript, too.
364180c
to
a76d713
Compare
0ac0409
to
3a230b3
Compare
Flaky tests detected in 3a230b3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9174057935
|
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
What?
Instead of reducing the store hundreds of times when updating with the initial block list settings, we could be combining them all into a single action.
Why?
In my testing this reduces the update from ~60-70ms to ~4-5ms.
The load perf test contains many, many things, so I don't expect a huge difference from a 60ms change. Still worth doing imo.Actually the first block metric seems to be down a bit:
Post editor: -5.37%, 0.29%, -5.37% (yes, twice exactly the same)
Site editor: -2.30%, -6.78%, -1.66%
How?
Testing Instructions
All tests should pass.
Testing Instructions for Keyboard
Screenshots or screencast